package pl.asoft.nbp.service;

import pl.asoft.nbp.model.ExchangeRate;

import java.util.Date;
import java.util.List;

/**
 * Created by rbiedrawa on 2014-12-02.
 */
public interface ExchangeRateService {

    List<ExchangeRate> findAllExistingExchangeRates();
    List<ExchangeRate> findAllExistingExchangeRates(String currencyCode);

    ExchangeRate findByCurrencyCodeAndDate(String currencyCode, Date date);

    List<ExchangeRate> findAllByDateBetween(Date startDate, Date endDate);
    List<ExchangeRate> findAllByDateBetween(String currencyCode, Date startDate, Date endDate);

    List<ExchangeRate> findActualExchangeRates();
    ExchangeRate findActualExchangeRate(String currencyCode);

    Double getAverageForCurrencyCode(String currencyCode);
    Double getAverageForCurrencyCode(String currencyCode, Date startDate, Date endDate);

    List<ExchangeRate> withMaxPriceForCurrencyCode(String currencyCode);
    List<ExchangeRate> withMaxPriceForCurrencyCode(String currencyCode, Date startDate, Date endDate);

    List<ExchangeRate> withMinPriceForCurrencyCode(String currencyCode);
    List<ExchangeRate> withMinPriceForCurrencyCode(String currencyCode, Date startDate, Date endDate);

    List<ExchangeRate> getAllAboveAverage(String currencyCode);
    List<ExchangeRate> getAllBelowAverage(String currencyCode);

    List<ExchangeRate> getBestExchangeRates(String currencyCode, int resultLimit);
    List<ExchangeRate> getWorstExchangeRates(String currencyCode, int resultLimit);

    List<ExchangeRate> getExchangeRateForDate(Date date);

    ExchangeRate addExchangeRate(ExchangeRate exchangeRate);
    void addExchangeRate(List<ExchangeRate> exchangeRates);

    ExchangeRate updateExchangeRate(ExchangeRate exchangeRate);

    void removeExchangeRate(ExchangeRate exchangeRate);
}
